n = int(input())
nums = []
for _ in range(n):
    num = int(input())
    nums.append(num)

max_num = max(nums)
for i in range(len(nums)):
    if nums[i] == max_num:
        print(max_num)
        print(i + 1)
        break